home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / wb-enhancement / bangermenu / bangermenu.asm < prev    next >
Assembly Source File  |  1996-02-19  |  41KB  |  1,890 lines

  1. ;Programm: BangerMenu bietet eine grafische Oberfläche zum Anwählen von Programmen
  2. ;          die beim Starten in der Startup-Sequence aufgerufen werden sollen.
  3. ;Autor   : Andre´ Trettin
  4. ;Codename: Banger
  5. ;Begin   : 31-Mai-95 17:08:28
  6. ;$VER    : BangerMenu.Asm 3.05 (19-Feb-96)
  7.  
  8. ** INCLUDE Struktur Variablen
  9. * Fehler Codes: 21=kein Speicher
  10. *               22=konnte Library (oder Libraries) nicht öffnen
  11. *               23=GetVisualInfo Fehler
  12. *               24=konnte File S:BangerMenu.Prefs nicht öffnen
  13. *               25=bei der Gadgeterschaffung trat ein Fehler auf
  14. *               26=konnte Fenster nicht öffnen oder Task nicht Finden
  15. *               27=Einstellungen sind Leer
  16. *               28=kein Speicher für die Einstellungen
  17. *               29=kein MsgPort
  18. *               30=konnte kein IORequest create
  19. *               31=konnte Device nicht öffnen
  20. *               32=falsche Parameter angabe
  21. *               33=zu viele Gadget (>2560)
  22. *               34=konnte MonitorTreiber Datei nicht laden
  23. *               35=Monitor mit angebenen ID nicht gefunden
  24. *               36=konnte Screen nicht öffnen
  25. *               37=Fehler im Einstellungsfile
  26. *               38=Menu Fehler
  27. *               10=Return Code für die Startup-Sequence
  28.  
  29.     incdir  INCLUDE:
  30.     include exec/exec.i
  31.     include exec/io.i
  32.     include devices/input.i
  33.     include devices/inputevent.i
  34.     include dos/dos.i
  35.     include dos/dosextens.i
  36.     include intuition/intuition.i
  37.     include libraries/gadtools.i
  38.     include lvo/exec_lib.i
  39.     include lvo/dos_lib.i
  40.     include lvo/intuition_lib.i
  41.     include lvo/gadtools_lib.i
  42.     include lvo/graphics_lib.i
  43.     include lvo/input_lib.i
  44.  
  45.     STRUCTURE BangerMenu,0
  46.     APTR    BaM_MenuTitleText
  47.     APTR    BaM_MenuKey
  48.     STRUCT  BaM_SpaltenTitleText,[50*4]
  49.     STRUCT  BaM_SpaltenLaenge,[50]
  50.     STRUCT  BaM_GadgetLaenge,[50]
  51.     BYTE    BaM_SpaltenAnzahl
  52.     BYTE    BaM_SeitenAnzahl
  53.     WORD    BaM_GadgetAnzahl
  54.     LABEL   BaM_SIZEOF
  55.  
  56.     STRUCTURE Internal,0
  57.     APTR    INTUIBase
  58.     APTR    DOSBase
  59.     APTR    GADBase
  60.     APTR    GFXBase
  61.     APTR    WindowHandle
  62.     APTR    OutputHandle
  63.     APTR    ScreenHandle
  64.     APTR    VisualInfo
  65.     APTR    WinRPort
  66.     APTR    PrefsFileHandle
  67.     APTR    FileSpeicher
  68.     APTR    FontAddr
  69.     APTR    meinTask
  70.     APTR    alterTask
  71.     APTR    AnGad
  72.     APTR    MsgPortAddr
  73.     APTR    MonitorKey
  74.     APTR    MoniID
  75.     APTR    NOKEYArray
  76.     APTR    RDArgs
  77.     APTR    MenuPtr
  78.     APTR    PrintMarkTab
  79.     STRUCT  FIB,[fib_SIZEOF]
  80.     STRUCT  TastenIBlock,[IO_SIZE]
  81.     STRUCT  MenuData,[BaM_SIZEOF*50]
  82.     STRUCT  PrintData,[it_SIZEOF*20]
  83.     STRUCT  VirtualMenu,[gnm_SIZEOF*55]
  84.     STRUCT  GadgetAddr,[2600*4]     ;Alle GadgetsAddressen max 2600
  85.     STRUCT  GadgetListe,[11*4]      ;Einzelnen GadgetListe (Window)
  86.     STRUCT  PageLAddr,[11*4]        ;eine Seite zurück
  87.     STRUCT  PageRAddr,[11*4]        ;eine Seite vor
  88.     STRUCT  GadgetPage,[11*4]       ;Gadgetanfang einer Seite
  89.     STRUCT  PrintPage,[11*4]        ;PrintIText Addr
  90.     LONG    Filegroesse
  91.     LONG    GadUniLang
  92.     WORD    HoeheWin
  93.     WORD    BreiteWin
  94.     WORD    AlteHoeheWin
  95.     WORD    AlteBreiteWin
  96.     WORD    CAPS
  97.     WORD    SCHoehe
  98.     WORD    SCBreite
  99.     WORD    AnzahlGADs
  100.     WORD    MaxZeile
  101.     WORD    MaxSeite
  102.     WORD    AnPage
  103.     WORD    MaxSpaltenZahl
  104.     BYTE    JetztigeSeite
  105.     BYTE    LetzteSPLaenge
  106.     BYTE    ErsteSPLaenge
  107.     BYTE    VorigeSeitenLaenge
  108.     BYTE    VorigeSPSeiten
  109.     BYTE    NaechsteSPSeiten
  110.     BYTE    VorigeSPLaenge
  111.     BYTE    RelativeGDPos
  112.     BYTE    JetztigeSPLaenge
  113.     BYTE    NaechsteSPLaenge
  114.     BYTE    TextUOFlag
  115.     BYTE    SpalteOhneTitle
  116.     BYTE    MenuEintragAnzahl
  117.     BYTE    ZweitePage
  118.     BYTE    ScreenSignal
  119.     BYTE    RelativeTopC
  120.     BYTE    RelativeLeftC
  121.     BYTE    MenuAnGe
  122.     BYTE    AnzahlPage
  123.     LABEL   Int_SIZEOF
  124. ;;
  125. ** Hauptprog
  126.     moveq   #0,d7
  127.     move.l  4.w,a6
  128.     move.l  #Int_SIZEOF,d0
  129.     move.l  #MEMF_PUBLIC!MEMF_CLEAR,d1
  130.     jsr     _LVOAllocMem(a6)
  131.     move.l  d0,a5
  132.     bne.s   LibraryO
  133.     moveq   #21,d7           ;21 = kein Speicher
  134.     bra.w   Ende
  135. LibraryO
  136.     bsr.w   InitRelative
  137.     bsr.w   LibOeffne
  138.     tst.w   d7
  139.     bne.w   SchliesseLibrary
  140.     bsr.w   Parameter
  141.     tst.w   d7
  142.     bne.s   SchliesseLibrary
  143.     bsr.w   WaitOnCaps
  144.     cmp.w   #10,d7
  145.     bhi.s   ParameterFree
  146.     tst.w   d7
  147.     beq.s   Menuerscheine
  148.     moveq   #0,d7
  149.     bra.s   ParameterFree
  150. Menuerscheine
  151.     bsr.w   PubScreenOeffne
  152.     tst.w   d7
  153.     bne.s   ParameterFree
  154.     bsr.w   LadePrefs
  155.     tst.w   d7
  156.     bne.s   SchliesseScreen
  157.     bsr.w   WertePrefsAus
  158.     tst.w   d7
  159.     bne.s   FreiSPrefs
  160.     bsr.w   InitMenu
  161.     tst.b   d7
  162.     bne.s   MenuRemove
  163.     bsr.w   InitGadget
  164.     tst.w   d7
  165.     bne.s   MenuRemove
  166.     bsr.w   FensterOeffne
  167.     tst.w   d7
  168.     bne.s   RemGad
  169.     bsr.w   SetAndLayout
  170.     tst.b   d7
  171.     bne.s   SchliesseFenster
  172.     move.w  #0,d5
  173.     bsr.w   PrintIUnter
  174.     bsr.w   GadAktivieren
  175.     bsr.w   RefreshWin
  176.     bsr.w   MessageAbFragen
  177.     bsr.w   ClearMenu
  178. SchliesseFenster
  179.     bsr.w   FensterSchliesse
  180. RemGad
  181.     bsr.w   RemoveGadget
  182. MenuRemove
  183.     bsr.w   RemoveMenu
  184. FreiSPrefs
  185.     bsr.w   SpeicherPrefs
  186. SchliesseScreen
  187.     bsr.w   ScreenSchliesse
  188. ParameterFree
  189.     bsr.w   FreePara
  190. SchliesseLibrary
  191.     bsr.w   LibSchliesse
  192.     move.l  a5,a1
  193.     move.l  #Int_SIZEOF,d0
  194.     jsr     _LVOFreeMem(a6)
  195. Ende
  196.     move.l  d7,d0
  197. ende
  198.     rts
  199. ;;
  200. ** InitMenu
  201. InitMenu
  202.     lea     UniGad(pc),a1
  203.     move.b  RelativeTopC(a5),d4
  204.     move.b  RelativeLeftC(a5),d5
  205.     add.b   d4,gng_TopEdge+1(a1)
  206.     add.b   d5,gng_LeftEdge+1(a1)
  207.     move.l  VisualInfo(a5),gng_VisualInfo(a1)
  208.     move.l  FontAddr(a5),gng_TextAttr(a1)
  209.     lea     PageGads(pc),a1
  210.     add.b   d4,gng_TopEdge+1(a1)
  211.     add.b   d5,gng_LeftEdge+1(a1)
  212.     move.l  VisualInfo(a5),gng_VisualInfo(a1)
  213.     move.l  FontAddr(a5),gng_TextAttr(a1)
  214.     lea     PageLeftTxt(pc),a2
  215.     move.l  a2,gng_GadgetText(a1)
  216.     lea     Page2Gads(pc),a1
  217.     add.b   d4,gng_TopEdge+1(a1)
  218.     add.b   d5,gng_LeftEdge+1(a1)
  219.     move.l  VisualInfo(a5),gng_VisualInfo(a1)
  220.     move.l  FontAddr(a5),gng_TextAttr(a1)
  221.     lea     PageRightTxt(pc),a2
  222.     move.l  a2,gng_GadgetText(a1)
  223.     lea     VirtualMenu(a5),a0
  224.     move.b  #NM_TITLE,gnm_Type(a0)
  225.     lea     ProjektName(pc),a1
  226.     move.l  a1,gnm_Label(a0)
  227.     lea     gnm_SIZEOF(a0),a0
  228.     move.b  #NM_ITEM,gnm_Type(a0)
  229.     lea     InfoName(pc),a1
  230.     move.l  a1,gnm_Label(a0)
  231.     lea     InfoTaste(pc),a1
  232.     move.l  a1,gnm_CommKey(a0)
  233.     lea     gnm_SIZEOF(a0),a0
  234.     move.b  #NM_ITEM,gnm_Type(a0)
  235.     lea     QuitName(pc),a1
  236.     move.l  a1,gnm_Label(a0)
  237.     lea     QuitTaste(pc),a1
  238.     move.l  a1,gnm_CommKey(a0)
  239.     move.b  MenuEintragAnzahl(a5),d0
  240.     tst.b   d0
  241.     beq.s   keinGrossesMenu
  242.     lea     gnm_SIZEOF(a0),a0
  243.     move.b  #NM_TITLE,gnm_Type(a0)
  244.     lea     WindowTitle(pc),a1
  245.     move.l  a1,gnm_Label(a0)
  246.     subq    #1,d0
  247.     lea     MenuData(a5),a1
  248. MenuInitLoop
  249.     lea     gnm_SIZEOF(a0),a0
  250.     move.b  #NM_ITEM,gnm_Type(a0)
  251.     move.l  BaM_MenuTitleText(a1),gnm_Label(a0)
  252.     move.l  BaM_MenuKey(a1),gnm_CommKey(a0)
  253.     lea     BaM_SIZEOF(a1),a1
  254.     dbra    d0,MenuInitLoop
  255. keinGrossesMenu
  256.     move.l  GADBase(a5),a6
  257.     lea     VirtualMenu(a5),a0
  258.     lea     MenuTags(pc),a1
  259.     jsr     _LVOCreateMenusA(a6)
  260.     move.l  d0,MenuPtr(a5)
  261.     beq.s   MenuError
  262.     move.l  d0,a0
  263.     move.l  VisualInfo(a5),a1
  264.     suba.l  a2,a2
  265.     jsr     _LVOLayoutMenusA(a6)
  266.     move.l  d0,d1
  267.     bne.s   MenuOK
  268. MenuError
  269.     moveq   #38,d7
  270. MenuOK
  271.     rts
  272. RemoveMenu
  273.     move.l  GADBase(a5),a6
  274.     move.l  MenuPtr(a5),a0
  275.     jsr     _LVOFreeMenus(a6)
  276.     rts
  277. ;;
  278. ** SetAndLayout ClearMenu PrintIUnter
  279. SetAndLayout
  280.     move.l  INTUIBase(a5),a6
  281.     move.l  WindowHandle(a5),a0
  282.     move.l  MenuPtr(a5),a1
  283.     jsr     _LVOSetMenuStrip(a6)
  284.     move.l  d0,d1
  285.     bne.s   SetLayOK
  286.     moveq   #38,d7
  287. SetLayOK
  288.     rts
  289. ClearMenu
  290.     move.l  INTUIBase(a5),a6
  291.     move.l  WindowHandle(a5),a0
  292.     jsr     _LVOClearMenuStrip(a6)
  293.     rts
  294. PrintIUnter
  295.     lea     PrintPage(a5),a1
  296.     lea     (a1,d5.w),a1
  297.     move.l  (a1),a1
  298.     lea     it_SIZEOF(a1),a1
  299.     move.l  WinRPort(a5),a0
  300.     moveq   #0,d0
  301.     moveq   #0,d1
  302.     move.b  RelativeTopC(a5),d1
  303.     move.b  RelativeLeftC(a5),d0
  304.     move.l  INTUIBase(a5),a6
  305.     jsr     _LVOPrintIText(a6)
  306.     rts
  307. ;;
  308. ** WertePrefsAus
  309. WertePrefsAus
  310.     move.w  SCHoehe(a5),d0
  311.     sub.w   #20,d0
  312.     moveq   #10,d1
  313.     divu.w  d1,d0
  314.     move.w  d0,MaxSpaltenZahl(a5)
  315.     move.l  FileSpeicher(a5),a1     ;PrefsFile anfang
  316.     move.l  Filegroesse(a5),d0
  317.     move.l  a1,a2
  318.     lea     1(a1),a1                ;erstes Zeichen ein Return !
  319.     add.l   d0,a2                   ;PrefsFile Ende
  320. MenuDochNoch
  321.     cmp.l   #'MENU',(a1)
  322.     beq.s   MenuEintrag
  323. keinMenuReturn
  324.     cmp.b   #10,(a1)+
  325.     bne.s   keinMenuReturn
  326.     cmp.l   a1,a2
  327.     bne.s   MenuDochNoch
  328.     lea     MenuData(a5),a3
  329.     move.l  FileSpeicher(a5),a1
  330.     lea     1(a1),a1                ;erstes Zeichen ein Return !
  331.     bra.w   UnterMenuGefunden
  332. MenuEintrag
  333.     lea     MenuData(a5),a3
  334.     moveq   #0,d0
  335. EintragMenuSLoop
  336.     cmp.b   #10,(a1)+
  337.     bne.s   EintragMenuSLoop
  338. EintragMenu2Loop
  339.     move.b  #0,-1(a1)
  340.     cmp.l   #'ENDM',(a1)
  341.     beq.s   AlleMenuEintrage
  342.     cmp.l   a1,a2
  343.     beq.w   PrefsWerteError
  344.     lea     1(a1),a1
  345.     move.l  a1,(a3)
  346. weiterSuchenMKey
  347.     move.b  (a1)+,d1
  348.     cmp.l   #'MKEY',(a1)
  349.     beq.s   TasteFuerMenu
  350.     cmp.b   #10,d1
  351.     bne.s   weiterSuchenMKey
  352. MKeyGefunden    
  353.     lea     BaM_SIZEOF(a3),a3
  354.     addq    #1,d0
  355.     cmp.b   #50,d0
  356.     beq.s   AlleMenuEintrage
  357.     bra.s   EintragMenu2Loop
  358. TasteFuerMenu
  359.     move.b  #0,-1(a1)
  360.     lea     5(a1),a1
  361.     move.l  a1,BaM_MenuKey(a3)
  362. EintragMenu3Loop    
  363.     cmp.b   #10,(a1)+
  364.     bne.s   EintragMenu3Loop
  365.     bra.s   MKeyGefunden
  366. AlleMenuEintrage
  367.     move.b  d0,MenuEintragAnzahl(a5)
  368.     lea     MenuData(a5),a3
  369. NaechstesUnterM 
  370.     move.l  BaM_MenuTitleText(a3),a0
  371.     move.l  FileSpeicher(a5),a1
  372.     lea     1(a1),a1                ;erstes Zeichen ein Return !
  373.     move.b  (a0),d0
  374. TestUnterMenuLoop
  375.     cmp.b   (a1),d0
  376.     beq.s   MenuBezeich
  377. keinMenuBezReturn
  378.     cmp.b   #10,(a1)+
  379.     bne.s   keinMenuBezReturn
  380.     cmp.l   a1,a2
  381.     bne.s   TestUnterMenuLoop
  382.     bra.w   PrefsWerteError
  383. MenuBezeich
  384.     move.l  a0,a4
  385. MenuBezeichLoop
  386.     move.b  (a0)+,d1
  387.     tst.b   d1
  388.     beq.s   UnterErstGefunden
  389.     cmp.b   (a1)+,d1
  390.     beq.s   MenuBezeichLoop
  391.     move.l  a4,a0
  392.     bra.s   keinMenuBezReturn
  393. UnterErstGefunden   
  394.     move.b  #0,(a1)+
  395. UnterMenuGefunden
  396.     moveq   #0,d5
  397.     moveq   #0,d4
  398. UnterMenu2Loop
  399.     moveq   #0,d0
  400.     moveq   #0,d2
  401.     moveq   #0,d3
  402. UnterMenuLoop
  403.     moveq   #0,d1
  404.     cmp.l   a1,a2
  405.     beq.w   UnterMenuFertig
  406.     cmp.l   #'END ',(a1)
  407.     beq.w   UnterMenuFertig
  408.     cmp.l   #'COLT',(a1)
  409.     beq.s   SpaltenTitle
  410.     lea     1(a1),a1
  411. keinReturn
  412.     addq    #1,d1             ;länge GadgetName aus der Prefs
  413.     cmp.b   #10,(a1)+
  414.     bne.s   keinReturn
  415.     move.b  #0,-1(a1)         ;das Return mit NullByte abschliessen
  416.     tst.b   d3                ;d3 0/1 entweder Gadgetname oder Programm bzw. Batchdatei
  417.     beq.s   BreiteZaehlen
  418.     moveq   #0,d3
  419.     bra.s   wortkleiner
  420. BreiteZaehlen
  421.     moveq   #1,d3
  422.     addq    #1,d0             ;d0=Anzahl der Gadgets
  423.     cmp.b   d2,d1             ;d2 enthält den längsten Gadgetnamen
  424.     bls.s   wortkleiner
  425.     move.b  d1,d2             ;neue länge war größer als alte
  426. wortkleiner
  427.     bra.s   UnterMenuLoop
  428. SpaltenTitle
  429.     cmp.b   #50,d4
  430.     beq.w   MenuIstVoll
  431.     lea     9(a1),a1
  432.     tst.b   d4
  433.     beq.s   keineBaMDaten
  434.     bsr.s   Spalteninit
  435.     tst.l   d7
  436.     bne.s   MenuGadgetzuviel
  437.     bra.s   BaMDatenDA
  438. keineBaMDaten
  439.     lea     BaM_SpaltenTitleText(a3),a0
  440. BaMDatenDA  
  441.     move.l  a1,(a0)
  442. SpaltenTitleLoop
  443.     cmp.b   #10,(a1)+
  444.     bne.s   SpaltenTitleLoop
  445.     move.b  #0,-1(a1)
  446.     addq    #1,d4             ;d4=SpaltenAnzahl
  447.     bra.s   UnterMenu2Loop
  448. MenuGadgetzuviel
  449.     cmp.l   #-1,d7
  450.     bne.s   NichtsGadgetAbzieh
  451.     sub.w   d0,d5
  452. NichtsGadgetAbzieh
  453.     moveq   #0,d7
  454.     bra.w   MenuIstVoll
  455. Spalteninit
  456.     moveq   #-1,d7
  457.     add.w   d0,d5
  458.     cmp.w   #2560,d5
  459.     bge.s   keineSpaltemehrMoeg
  460.     move.w  d4,d6
  461.     subq    #1,d6
  462.     lea     BaM_GadgetLaenge(a3),a6
  463.     lea     (a6,d6.w),a6
  464.     lea     BaM_SpaltenLaenge(a3),a4
  465.     lea     (a4,d6.w),a4
  466.     add.w   d6,d6
  467.     add.w   d6,d6
  468.     lea     BaM_SpaltenTitleText(a3),a0
  469.     lea     (a0,d6.w),a0
  470.     move.l  (a0),d7
  471. SpaltenCheck
  472.     cmp.w   MaxSpaltenZahl(a5),d0
  473.     bls.s   nurnocheineSpalte
  474.     sub.w   MaxSpaltenZahl(a5),d0
  475.     move.b  MaxSpaltenZahl+1(a5),(a4)+
  476.     move.b  d2,(a6)+
  477.     move.l  d7,(a0)+
  478.     addq    #1,d4
  479.     cmp.b   #50,d4
  480.     beq.s   keineSpaltemehrMoeg
  481.     bra.s   SpaltenCheck
  482. nurnocheineSpalte
  483.     move.b  d0,(a4)
  484.     move.b  d2,(a6)
  485.     move.l  d7,(a0)+
  486.     moveq   #0,d7
  487. keineSpaltemehrMoeg
  488.     rts
  489. UnterMenuFertig
  490.     tst.b   d4
  491.     bne.s   JauEinSpalt
  492.     move.w  d4,d6
  493.     addq    #1,d4
  494.     move.w  d0,d1
  495.     add.w   d1,d1
  496.     tst.b   d1
  497.     beq.s   JauEinSpalt
  498.     move.l  a1,a4
  499.     addq    #1,d1
  500. EndeVonMenu
  501.     tst.b   -(a4)
  502.     bne.s   EndeVonMenu
  503.     subq    #1,d1
  504.     bne.s   EndeVonMenu
  505. EinVorRueck
  506.     lea     1(a4),a4
  507.     cmp.b   #' ',(a4)
  508.     beq.s   EinVorRueck
  509.     add.w   d6,d6
  510.     add.w   d6,d6
  511.     lea     BaM_SpaltenTitleText(a3),a0
  512.     lea     (a0,d6.w),a0
  513.     move.l  a4,(a0)
  514.     move.b  #-1,SpalteOhneTitle(a5)
  515. JauEinSpalt 
  516.     bsr.w   Spalteninit
  517.     moveq   #0,d7
  518.     tst.b   SpalteOhneTitle(a5)
  519.     beq.s   MenuIstVoll
  520.     moveq   #-1,d4
  521.     move.b  #0,SpalteOhneTitle(a5)
  522. MenuIstVoll
  523.     lea     BaM_SpaltenAnzahl(a3),a4
  524.     move.b  d4,(a4)
  525.     lea     BaM_GadgetAnzahl(a3),a4
  526.     move.w  d5,(a4)
  527.     lea     BaM_SIZEOF(a3),a3
  528.     tst.l   (a3)
  529.     bne.w   NaechstesUnterM
  530.     rts
  531. PrefsWerteError
  532.     moveq   #37,d7
  533.     rts
  534. ;;
  535. ** Parameter
  536. Parameter
  537.     move.l  DOSBase(a5),a6
  538.     lea     ParaTemplate(pc),a1
  539.     move.l  a1,d1
  540.     lea     MonitorKey(a5),a1
  541.     move.l  a1,d2
  542.     moveq   #0,d3
  543.     jsr     _LVOReadArgs(a6)
  544.     move.l  d0,RDArgs(a5)
  545.     bne.s   ParaOK
  546.     jsr     _LVOIoErr(a6)
  547.     move.l  d0,d1
  548.     moveq   #0,d2
  549.     jsr     _LVOPrintFault(a6)
  550.     moveq   #32,d7
  551. ParaOK
  552.     rts
  553. FreePara
  554.     move.l  RDArgs(a5),d1
  555.     move.l  DOSBase(a5),a6
  556.     jsr     _LVOFreeArgs(a6)
  557.     rts
  558. ;;
  559. ** Warte auf Caps Lock
  560. WaitOnCaps
  561.     tst.l   NOKEYArray(a5)
  562.     bne.s   NOKeyJA
  563.     move.l  4.w,a6
  564.     jsr     _LVOCreateMsgPort(a6)
  565.     move.l  d0,MsgPortAddr(a5)
  566.     bne.s   MsgPortOK
  567.     moveq   #29,d7                  ;29 = kein MsgPort
  568.     addq    #4,a7
  569.     pea     SchliesseLibrary(pc)
  570.     rts
  571. MsgPortOK
  572.     move.l  d0,a0
  573.     move.l  #IOSTD_SIZE,d0
  574.     jsr     _LVOCreateIORequest(a6)
  575.     move.l  d0,TastenIBlock(a5)
  576.     bne.s   OeffneDev
  577.     moveq   #30,d7                  ;30=konnte kein IORequest create
  578.     bra.s   FreiMsgP
  579. OeffneDev
  580.     lea     inputname(pc),a0
  581.     move.l  d0,a1
  582.     moveq   #0,d0
  583.     move.l  #IOF_QUICK,d1
  584.     jsr     _LVOOpenDevice(a6)
  585.     tst.l   d0
  586.     beq.s   DevOK
  587.     moveq   #31,d7                   ;31=konnte Device nicht öffnen
  588.     bra.s   IOReqDel
  589. DevOK
  590.     move.l  TastenIBlock(a5),a0
  591.     move.l  IO_DEVICE(a0),a6
  592.     jsr     _LVOPeekQualifier(a6)
  593.     and.w   #IEQUALIFIER_CAPSLOCK,d0
  594.     cmp.w   #IEQUALIFIER_CAPSLOCK,d0
  595.     beq.s   CAPSgedrueckt
  596.     moveq   #10,d7
  597. CAPSgedrueckt
  598.     move.l  4.w,a6
  599.     lea     TastenIBlock(a5),a1
  600.     jsr     _LVOCloseDevice(a6)
  601. IOReqDel
  602.     move.l  TastenIBlock(a5),a0
  603.     jsr     _LVODeleteIORequest(a6)
  604. FreiMsgP
  605.     move.l  MsgPortAddr(a5),a0
  606.     jsr     _LVODeleteMsgPort(a6)
  607. NOKeyJA
  608.     rts
  609. ;;
  610. ** GadAktivieren
  611. GadAktivieren
  612.     move.l  GadgetAddr(a5),a3
  613.     lea     GadgetPage(a5),a4
  614.     lea     (a4,d5.w),a4
  615.     move.l  (a4),a4
  616.     move.l  (a4),a4
  617.     moveq   #1,d6
  618.     bsr.w   SelGK
  619.     lea     GadgetPage(a5),a4
  620.     lea     (a4,d5.w),a4
  621.     move.l  (a4),a4
  622.     move.l  a4,AnGad(a5)
  623.     rts
  624. ;;
  625. ** Relative Init
  626. InitRelative
  627.     lea     topazFName8(pc),a0
  628.     lea     topaz8(pc),a1
  629.     move.l  a0,(a1)
  630.     move.l  a1,FontAddr(a5)
  631.     rts
  632. ;;
  633. ** MessageAbFragen  MsgVerarbeitung Sprung
  634. MessageAbFragen
  635.     move.l  WindowHandle(a5),a0
  636.     move.l  wd_UserPort(a0),a0
  637.     move.l  4.w,a6
  638.     jsr     _LVOWaitPort(a6)
  639. nocheine
  640.     move.l  GADBase(a5),a6
  641.     move.l  WindowHandle(a5),a0
  642.     move.l  wd_UserPort(a0),a0
  643.     jsr     _LVOGT_GetIMsg(a6)
  644.     move.l  d0,a1
  645.     tst.l   d0
  646.     beq.s   MessageAbFragen
  647.     move.w  im_Qualifier(a1),d2
  648.     move.l  im_Class(a1),d3
  649.     move.w  im_Code(a1),d4
  650.     move.l  im_IAddress(a1),a4
  651.     jsr     _LVOGT_ReplyIMsg(a6)
  652.     cmpi.l  #IDCMP_CLOSEWINDOW,d3
  653.     beq.w   ende
  654.     cmpi.l  #IDCMP_REFRESHWINDOW,d3
  655.     beq.w   RefreWin
  656.     cmpi.l  #IDCMP_GADGETUP,d3
  657.     beq.w   GadAuswertung
  658.     cmpi.l  #IDCMP_VANILLAKEY,d3
  659.     beq.w   VanTaste
  660.     cmpi.l  #IDCMP_RAWKEY,d3
  661.     beq.w   RAWTaste
  662.     cmp.l   #IDCMP_MENUPICK,d3
  663.     beq.s   MenuAuswertung
  664.     bra.s   nocheine
  665. ** MenuAuswertung
  666. MenuAuswertung
  667.     cmpi.w  #MENUNULL,d4
  668.     beq.w   nocheine
  669.     cmp.w   #$F800,d4
  670.     beq.w   About
  671.     cmp.w   #$F820,d4
  672.     beq.w   ende
  673.     moveq   #0,d6
  674.     sub.w   #$F801,d4
  675. MenuErmittelLoop
  676.     tst.w   d4
  677.     beq.s   MenuWeiterWert
  678.     sub.w   #$20,d4
  679.     addq    #1,d6
  680.     bra.s   MenuErmittelLoop
  681. MenuWeiterWert
  682.     cmp.b   MenuAnGe(a5),d6
  683.     beq.w   nocheine
  684.     bsr.w   ReGadList
  685.     bsr.w   RemoveGadget
  686.     move.b  d6,MenuAnGe(a5)
  687.     move.w  HoeheWin(a5),AlteHoeheWin(a5)
  688.     move.w  BreiteWin(a5),AlteBreiteWin(a5)
  689.     bsr.w   InitGadget
  690.     tst.b   d7
  691.     beq.s   NeuMenuGadgetOK
  692.     rts
  693. NeuMenuGadgetOK 
  694.     moveq   #0,d5
  695.     move.w  d5,AnPage(a5)
  696.     move.w  AlteHoeheWin(a5),d0
  697.     cmp.w   HoeheWin(a5),d0
  698.     bls.s   VergroesserWin
  699.     move.w  AlteBreiteWin(a5),d0
  700.     cmp.w   BreiteWin(a5),d0
  701.     bgt.s   keinVergroessern
  702. VergroesserWin
  703.     move.l  WindowHandle(a5),a0
  704.     move.w  BreiteWin(a5),d0
  705.     sub.w   AlteBreiteWin(a5),d0
  706.     lsr.w   #1,d0
  707.     neg.w   d0
  708.     move.w  HoeheWin(a5),d1
  709.     sub.w   AlteHoeheWin(a5),d1
  710.     lsr.w   #1,d1
  711.     neg.w   d1
  712.     move.l  INTUIBase(a5),a6
  713.     jsr     _LVOMoveWindow(a6)
  714.     move.l  WindowHandle(a5),a0
  715.     move.w  BreiteWin(a5),d0
  716.     sub.w   AlteBreiteWin(a5),d0
  717.     move.w  HoeheWin(a5),d1
  718.     sub.w   AlteHoeheWin(a5),d1
  719.     jsr     _LVOSizeWindow(a6)
  720. keinVergroessern
  721.     bsr.w   AddGadList
  722.     bsr.w   PrintIUnter
  723.     bsr.w   GadAktivieren
  724.     bra.w   nocheine
  725. ;;
  726. ** About
  727. About
  728.     move.l  WindowHandle(a5),a0
  729.     lea     AbReqTi(pc),a2
  730.     lea     AbReqTxt(pc),a3
  731.     lea     AbGadTxt(pc),a4
  732.     lea     EndeReq(pc),a1
  733.     move.l  a2,8(a1)
  734.     move.l  a3,12(a1)
  735.     move.l  a4,16(a1)
  736.     suba.l  a2,a2
  737.     suba.l  a3,a3
  738.     move.l  INTUIBase(a5),a6
  739.     jsr     _LVOEasyRequestArgs(a6)
  740.     bra.w   nocheine
  741. ;;
  742. ** RefreWin
  743. RefreWin
  744.     bsr.w   RefreshWin
  745.     bra.w   nocheine
  746. ;;
  747. ** RAWTaste
  748. RAWTaste
  749.     move.b  d2,d1
  750.     and.b   #IEQUALIFIER_CONTROL,d1
  751.     bne.s   CtrlTaste
  752.     and.b   #IEQUALIFIER_LSHIFT!IEQUALIFIER_RSHIFT,d2
  753.     bne.s   ShiftTaste
  754.     cmp.b   #$4e,d4         ;rechts
  755.     beq.w   rechteBank
  756.     cmp.b   #$4f,d4         ;links
  757.     beq.w   linkeBank
  758.     cmp.b   #$4d,d4         ;Down
  759.     beq.w   DownTaste
  760.     cmp.b   #$4c,d4         ;Up
  761.     beq.w   UpTaste
  762.     bra.w   nocheine
  763. VanTaste
  764.     cmp.b   #$0d,d4
  765.     beq.s   Auswahl
  766.     cmp.b   #$1b,d4
  767.     beq.w   ende
  768.     cmp.b   #'<',d4
  769.     beq.s   PfeilLinks
  770.     cmp.b   #'>',d4
  771.     beq.s   PfeilRechts
  772.     bclr    #5,d4
  773.     cmp.b   #'Q',d4
  774.     beq.w   ende
  775.     bra.w   nocheine
  776. ShiftTaste
  777.     cmp.b   #$4e,d4         ;rechts+shift
  778.     beq.w   rechtsShift
  779.     cmp.b   #$4f,d4         ;links+shift
  780.     beq.w   linkeShift
  781.     cmp.b   #$4d,d4         ;Down+shift
  782.     beq.w   DownShift
  783.     cmp.b   #$4c,d4         ;Up+shift
  784.     beq.w   UpShift
  785.     bra.w   nocheine
  786. CtrlTaste
  787.     cmp.b   #$4e,d4         ;rechts+shift
  788.     beq.w   rechtsCtrl
  789.     cmp.b   #$4f,d4         ;links+shift
  790.     beq.w   linkeCtrl
  791.     bra.w   nocheine
  792. Auswahl
  793.     move.l  AnGad(a5),a4
  794.     move.l  (a4),a4
  795.     bra.s   GadExe
  796. PfeilLinks
  797.     tst.w   AnPage(a5)
  798.     beq.w   nocheine
  799.     bra.w   PageLGAn
  800. PfeilRechts
  801.     bsr.s   MenuDataInit
  802.     moveq   #0,d0
  803.     move.b  BaM_SeitenAnzahl(a4),d0
  804.     cmp.w   AnPage(a5),d0
  805.     beq.w   nocheine
  806.     bra.w   PageRGAn
  807. MenuDataInit
  808.     lea     MenuData(a5),a4
  809.     moveq   #0,d0
  810.     moveq   #0,d1
  811.     move.b  MenuAnGe(a5),d0
  812.     move.w  #BaM_SIZEOF,d1
  813.     mulu.w  d0,d1
  814.     lea     (a4,d1.w),a4
  815.     rts
  816. ;;
  817. ** GadAuswertung
  818. GadAuswertung
  819.     lea     PageLAddr(a5),a0
  820.     move.w  AnPage(a5),d5
  821.     lea     (a0,d5.w),a0
  822.     move.l  (a0),a0
  823.     cmp.l   a0,a4
  824.     beq.w   PageLGAn
  825.     lea     PageRAddr(a5),a0
  826.     lea     (a0,d5.w),a0
  827.     move.l  (a0),a0
  828.     cmp.l   a0,a4
  829.     beq.w   PageRGAn
  830. GadExe
  831.     move.l  gg_UserData(a4),a1
  832. SucheAnfangExe
  833.     tst.b   (a1)+
  834.     bne.s   SucheAnfangExe
  835.     move.l  a1,d1
  836.     moveq   #0,d2
  837.     moveq   #0,d3
  838.     move.l  DOSBase(a5),a6
  839.     jsr     _LVOExecute(a6)
  840.     moveq   #10,d7
  841.     rts
  842. ;;
  843. ;;
  844. ** TastenAuswertung
  845. UpTaste
  846.     move.l  AnGad(a5),a4
  847.     move.w  AnPage(a5),d5
  848.     lea     GadgetPage(a5),a3
  849.     lea     (a3,d5.w),a3
  850.     move.l  (a3),a3
  851.     cmp.l   a3,a4
  852.     beq.w   DownShift
  853.     lea     -4(a4),a3
  854.     bra.s   GadAnwaehlen
  855. DownTaste
  856.     move.l  AnGad(a5),a4
  857.     move.w  AnPage(a5),d5
  858.     lea     4(a4),a3
  859.     cmp.l   #0,(a3)
  860.     beq.w   UpShift
  861. GadAnwaehlen
  862.     move.l  (a4),a4
  863.     moveq   #0,d6
  864.     bsr.w   SelGK
  865.     moveq   #1,d6
  866.     move.l  (a3),a4
  867.     bsr.w   SelGK
  868.     move.l  (a3),a3
  869.     bsr.w   GetGAddr
  870.     bra.w   nocheine
  871. rechteBank
  872.     bsr.w   NummerGad            
  873.     tst.b   NaechsteSPLaenge(a5)
  874.     beq.s   letztesGDAnw
  875.     tst.b   NaechsteSPSeiten(a5)
  876.     bne.s   NeueSeitebeiRechts
  877.     move.b  NaechsteSPLaenge(a5),d0
  878.     move.b  RelativeGDPos(a5),d1
  879.     cmp.b   d0,d1
  880.     bgt.s   RechteSpalteLang
  881.     move.b  JetztigeSPLaenge(a5),d0
  882.     add.b   d4,d0
  883.     bra.s   DieSelbigeSeite
  884. RechteSpalteLang
  885.     add.b   d0,d4
  886.     move.b  JetztigeSPLaenge(a5),d0
  887.     sub.b   d1,d0
  888.     add.b   d4,d0
  889.     bra.s   DieSelbigeSeite 
  890. NeueSeitebeiRechts
  891.     move.l  AnGad(a5),a4
  892.     move.w  AnPage(a5),d5
  893.     addq    #4,d5
  894.     move.b  RelativeGDPos(a5),d0
  895.     move.b  NaechsteSPLaenge(a5),d1
  896.     cmp.b   d0,d1
  897.     bgt.s   SpaltePasst
  898.     move.b  d1,d0
  899. SpaltePasst
  900.     bra.w   NeueSeite
  901. letztesGDAnw
  902.     move.b  JetztigeSPLaenge(a5),d0
  903. DieSelbigeSeite
  904.     subq    #1,d0
  905. DieSelbige2Seite    
  906.     add.w   d0,d0                ;*4
  907.     add.w   d0,d0
  908.     move.w  AnPage(a5),d5
  909.     move.l  AnGad(a5),a4
  910.     lea     GadgetPage(a5),a3
  911.     lea     (a3,d5.w),a3
  912.     move.l  (a3),a3
  913.     lea     (a3,d0.w),a3
  914.     bra.w   GadAnwaehlen
  915. linkeBank
  916.     bsr.w   NummerGad
  917.     tst.b   VorigeSPLaenge(a5)
  918.     beq.s   erstesGDAnw
  919.     tst.b   VorigeSPSeiten(a5)
  920.     bne.s   NeueSeitebeiLinks
  921.     move.b  VorigeSPLaenge(a5),d0
  922.     move.b  RelativeGDPos(a5),d1
  923.     cmp.b   d0,d1
  924.     bhi.s   LinkeSpalteLang
  925.     sub.b   d0,d4
  926.     move.b  d4,d0
  927.     bra.w   DieSelbigeSeite
  928. LinkeSpalteLang
  929.     move.b  d4,d0
  930.     sub.b   d1,d0
  931.     bra.w   DieSelbigeSeite
  932. erstesGDAnw
  933.     moveq   #1,d0
  934.     bra.w   DieSelbigeSeite
  935. NeueSeitebeiLinks
  936.     move.l  AnGad(a5),a4
  937.     move.w  AnPage(a5),d5
  938.     subq    #4,d5
  939.     move.b  VorigeSeitenLaenge(a5),d0
  940.     move.b  VorigeSPLaenge(a5),d1
  941.     move.b  RelativeGDPos(a5),d2
  942.     cmp.b   d1,d2
  943.     bgt.s   NeueSeite
  944.     sub.b   d1,d0
  945.     add.b   d2,d0
  946. ** NeueSeite
  947. * d0 = Neues Angewähltes GadgetNr. relative zum Anfang
  948. * d5 = Neue SeitenNummer
  949. * a4 = Alte GadgetAddr
  950. NeueSeite
  951.     subq    #1,d0
  952. NeueSeite2  
  953.     cmp.b   #36,d5
  954.     bgt.w   nocheine
  955.     move.w  d0,d7
  956.     move.l  (a4),a4
  957.     moveq   #0,d6
  958.     bsr.w   SelGK
  959.     bsr.w   ReGadList
  960.     move.w  d5,AnPage(a5)
  961.     bsr.w   AddGadList
  962.     add.w   d7,d7                ;*4
  963.     add.w   d7,d7
  964.     lea     GadgetPage(a5),a3
  965.     lea     (a3,d5.w),a3
  966.     move.l  (a3),a3
  967.     lea     (a3,d7.w),a3
  968.     moveq   #0,d7
  969.     moveq   #1,d6
  970.     move.l  (a3),a4
  971.     bsr.w   SelGK
  972.     move.l  (a3),a3
  973.     bsr.w   GetGAddr
  974.     bsr.w   PrintIUnter
  975.     bra.w   nocheine
  976. ;;
  977. ** NummerGad
  978. NummerGad
  979.     move.l  AnGad(a5),a4
  980.     move.l  (a4),a3
  981.     move.w  gg_GadgetID(a3),d6
  982.     bsr.w   MenuDataInit
  983.     lea     BaM_SpaltenLaenge(a4),a3
  984.     lea     BaM_GadgetLaenge(a4),a2
  985.     moveq   #0,d5
  986.     move.b  BaM_SpaltenAnzahl(a4),d5
  987.     tst.b   d5
  988.     bpl.s   keineUnsinnigeSpalte
  989.     moveq   #1,d5
  990. keineUnsinnigeSpalte
  991.     subq    #1,d5
  992.     move.b  #0,VorigeSPLaenge(a5)
  993.     moveq   #0,d0
  994.     moveq   #20,d2
  995.     move.b  d6,d4
  996.     move.b  (a3),d0
  997.     move.b  d0,ErsteSPLaenge(a5)
  998. SpaltenHochZLoop
  999.     bsr.s   SCBreiteBestimmen
  1000.     cmp.w   SCBreite(a5),d2
  1001.     bhi.w   SeiteNeuBeiSpalte
  1002.     move.b  #0,VorigeSPSeiten(a5)
  1003. VorigeSeiteKoori
  1004.     sub.b   d0,d6
  1005.     cmp.b   #1,d6
  1006.     blt.s   GadgetSpalteGef
  1007.     move.b  d0,VorigeSPLaenge(a5)
  1008.     add.w   #20,d2
  1009.     dbra    d5,SpaltenHochZLoop
  1010. GadgetSpalteGef
  1011.     add.w   #20,d2
  1012.     move.b  d0,JetztigeSPLaenge(a5)
  1013.     move.b  d6,RelativeGDPos(a5)
  1014.     add.b   d0,RelativeGDPos(a5)
  1015.     tst.b   d5
  1016.     beq.s   keineSpaltenLaengen
  1017.     moveq   #0,d0
  1018.     bsr.s   SCBreiteBestimmen
  1019.     move.b  d0,NaechsteSPLaenge(a5)
  1020.     cmp.w   SCBreite(a5),d2
  1021.     bhi.s   SeiteNeuBeiNaechster
  1022.     move.b  #0,NaechsteSPSeiten(a5)
  1023. NaechsteSeiteKoori
  1024.     add.w   #20,d2
  1025.     sub.b   d0,d6
  1026.     bsr.s   SCBreiteBestimmen
  1027.     cmp.w   SCBreite(a5),d2
  1028.     bhi.s   SeiteNeuBei2Naechster
  1029.     dbra    d5,NaechsteSeiteKoori
  1030.     sub.b   d0,d6
  1031. KorriKeineSpalten
  1032.     neg.b   d6
  1033.     move.b  d6,d0
  1034.     add.b   d4,d0
  1035.     move.b  d0,JetztigeSeite(a5)
  1036.     move.b  -(a3),LetzteSPLaenge(a5)
  1037. SeiteKorriRueck
  1038.     rts
  1039. keineSpaltenLaengen
  1040.     move.b  #0,NaechsteSPSeiten(a5)
  1041.     move.b  #0,NaechsteSPLaenge(a5)
  1042.     bra.s   KorriKeineSpalten
  1043. SCBreiteBestimmen
  1044.     move.b  (a3)+,d0
  1045.     moveq   #0,d1
  1046.     move.b  (a2)+,d1
  1047.     asl.w   #3,d1
  1048.     add.w   #10,d1
  1049.     add.w   d1,d2
  1050.     rts
  1051. SeiteNeuBeiSpalte
  1052.     moveq   #0,d2
  1053.     sub.b   d6,d4
  1054.     move.b  d4,VorigeSeitenLaenge(a5)
  1055.     move.b  d6,d4
  1056.     move.b  #1,VorigeSPSeiten(a5)
  1057.     move.b  d0,ErsteSPLaenge(a5)
  1058.     bra.w   VorigeSeiteKoori
  1059. SeiteNeuBeiNaechster
  1060.     move.b  #1,NaechsteSPSeiten(a5)
  1061. SeiteNeuBei2Naechster
  1062.     neg.b   d6
  1063.     move.b  d6,d0
  1064.     add.b   d4,d0
  1065.     move.b  d0,JetztigeSeite(a5)
  1066.     move.b  -2(a3),LetzteSPLaenge(a5)
  1067.     bra.s   SeiteKorriRueck
  1068. ;;
  1069. ** GetGAddr
  1070. * a3 = Neue GadgetAddr
  1071. GetGAddr
  1072.     lea     GadgetPage(a5),a4
  1073.     lea     (a4,d5.w),a4
  1074.     move.l  (a4),a4
  1075. FindeGAdd
  1076.     cmp.l   (a4)+,a3
  1077.     bne.s   FindeGAdd
  1078.     lea     -4(a4),a4
  1079.     move.l  a4,AnGad(a5)
  1080.     rts
  1081. ;;
  1082. ** Auswertung PageLeft/PageRight Ctrl Shift
  1083. PageLGAn
  1084.     moveq   #-4,d5
  1085. NeueSeiteLeft
  1086.     add.w   AnPage(a5),d5
  1087. NeueSeite2Left  
  1088.     move.l  AnGad(a5),a4
  1089.     moveq   #0,d0
  1090.     bra.w   NeueSeite2
  1091. PageRGAn
  1092.     moveq   #4,d5
  1093.     bra.s   NeueSeiteLeft
  1094. rechtsCtrl
  1095.     bsr.w   MenuDataInit
  1096.     moveq   #0,d1
  1097.     move.b  BaM_SeitenAnzahl(a4),d1
  1098.     tst.b   d1
  1099.     beq.w   nocheine
  1100.     cmp.w   AnPage(a5),d1
  1101.     bne.s   PageRGAn
  1102.     moveq   #0,d5
  1103.     bra.s   NeueSeite2Left
  1104. linkeCtrl
  1105.     bsr.w   MenuDataInit
  1106.     tst.w   AnPage(a5)
  1107.     bne.s   PageLGAn
  1108.     moveq   #0,d5
  1109.     move.b  BaM_SeitenAnzahl(a4),d5
  1110.     bra.s   NeueSeite2Left
  1111. UpShift
  1112.     bsr.w   NummerGad
  1113.     sub.b   RelativeGDPos(a5),d4
  1114.     move.b  d4,d0
  1115.     bra.w   DieSelbige2Seite
  1116. DownShift
  1117.     bsr.w   NummerGad
  1118.     move.b  JetztigeSPLaenge(a5),d0
  1119.     sub.b   RelativeGDPos(a5),d0
  1120.     add.b   d4,d0
  1121.     bra.w   DieSelbigeSeite
  1122. linkeShift
  1123.     bsr.w   NummerGad
  1124.     move.b  RelativeGDPos(a5),d0
  1125.     move.b  ErsteSPLaenge(a5),d1
  1126.     cmp.b   d0,d1
  1127.     bgt.s   ShiftLinksPasst
  1128.     move.b  d1,d0
  1129. ShiftLinksPasst
  1130.     bra.w   DieSelbigeSeite
  1131. rechtsShift
  1132.     bsr.w   NummerGad
  1133.     move.b  JetztigeSeite(a5),d0
  1134.     move.b  LetzteSPLaenge(a5),d1
  1135.     sub.b   RelativeGDPos(a5),d1
  1136.     bmi.s   ShiftRechtsPasst
  1137.     sub.b   d1,d0
  1138. ShiftRechtsPasst
  1139.     bra.w   DieSelbigeSeite
  1140. ;;
  1141. **SelGK Selektiert Gadget also ein oder aus
  1142. SelGK
  1143.     bsr.b   RemoveGSuche
  1144.     tst.l   d6
  1145.     beq.s   DisSel
  1146.     or.w    #GFLG_SELECTED,gg_Flags(a4)
  1147.     bra.s   NunSel
  1148. DisSel
  1149.     eor.w   #GFLG_SELECTED,gg_Flags(a4)
  1150. NunSel
  1151.     bsr.b   AddGSuche
  1152.     rts
  1153. RemoveGSuche
  1154.     move.l  WindowHandle(a5),a0
  1155.     move.l  a4,a1
  1156.     move.l  INTUIBase(a5),a6
  1157.     jsr     _LVORemoveGadget(a6)
  1158.     rts
  1159. AddGSuche
  1160.     move.l  WindowHandle(a5),a0
  1161.     move.l  a4,a1
  1162.     moveq   #-1,d0
  1163.     jsr     _LVOAddGadget(a6)
  1164.     move.l  a4,a0
  1165.     move.l  WindowHandle(a5),a1
  1166.     suba.l  a2,a2
  1167.     jsr     _LVORefreshGadgets(a6)
  1168.     rts
  1169. ReGadList
  1170.     move.l  WindowHandle(a5),a0
  1171.     lea     GadgetListe(a5),a1
  1172.     move.w  AnPage(a5),d4
  1173.     lea     (a1,d4.w),a1
  1174.     move.l  (a1),a1
  1175.     moveq   #-1,d0
  1176.     move.l  INTUIBase(a5),a6
  1177.     jsr     _LVORemoveGList(a6)
  1178.     move.l  WinRPort(a5),a1
  1179.     moveq   #0,d0
  1180.     move.l  GFXBase(a5),a6
  1181.     jsr     _LVOSetAPen(a6)
  1182.     move.l  WinRPort(a5),a1
  1183.     moveq   #2,d0
  1184.     moveq   #2,d1
  1185.     add.b   RelativeLeftC(a5),d0
  1186.     add.b   RelativeTopC(a5),d1
  1187.     move.w  BreiteWin(a5),d2
  1188.     subq    #5,d2
  1189.     move.w  HoeheWin(a5),d3
  1190.     subq    #5,d3
  1191.     jsr     _LVORectFill(a6)
  1192.     rts
  1193. AddGadList
  1194.     move.l  WindowHandle(a5),a0
  1195.     lea     GadgetListe(a5),a3
  1196.     lea     (a3,d5.w),a3
  1197.     move.l  (a3),a1
  1198.     moveq   #2,d0
  1199.     moveq   #-1,d1
  1200.     suba.l  a2,a2
  1201.     move.l  INTUIBase(a5),a6
  1202.     jsr     _LVOAddGList(a6)
  1203.     move.l  (a3),a0
  1204.     move.l  WindowHandle(a5),a1
  1205.     suba.l  a2,a2
  1206.     moveq   #-1,d0
  1207.     jsr     _LVORefreshGList(a6)
  1208.     bsr.s   RefreshWin
  1209.     rts
  1210. ;;
  1211. ;;
  1212. ** Refresh Fenster
  1213. RefreshWin
  1214.     move.l  GADBase(a5),a6
  1215.     move.l  WindowHandle(a5),a0
  1216.     suba.l  a1,a1
  1217.     jsr     _LVOGT_RefreshWindow(a6)
  1218.     move.l  WindowHandle(a5),a0
  1219.     jsr     _LVOGT_BeginRefresh(a6)
  1220.     move.l  WindowHandle(a5),a0
  1221.     moveq   #DOSTRUE,d0
  1222.     jsr     _LVOGT_EndRefresh(a6)
  1223.     rts 
  1224. ;;
  1225. ** Fenster Öffnen
  1226. FensterOeffne
  1227.     move.l  INTUIBase(a5),a6
  1228.     lea     Fenster_Tags(pc),a1
  1229.     move.l  GadgetListe(a5),12(a1)
  1230.     move.l  ScreenHandle(a5),60(a1)
  1231.     lea     WindowTitle(pc),a0
  1232.     move.l  a0,4(a1)
  1233.     lea     ScreenTitle(pc),a0
  1234.     move.l  a0,20(a1)
  1235.     move.w  BreiteWin(a5),d0
  1236.     move.w  d0,30(a1)
  1237.     sub.w   SCBreite(a5),d0
  1238.     neg.w   d0
  1239.     asr.w   #1,d0
  1240.     move.w  d0,54(a1)
  1241.     move.w  HoeheWin(a5),d4
  1242.     move.w  d4,38(a1)
  1243.     move.w  SCHoehe(a5),d0
  1244.     add.w   #50,d0
  1245.     sub.w   d4,d0
  1246.     asr.w   #1,d0
  1247.     move.w  d0,46(a1)
  1248.     suba.l  a0,a0
  1249.     jsr     _LVOOpenWindowTagList(a6)
  1250.     move.l  d0,WindowHandle(a5)
  1251.     beq.b   ErrorWindow
  1252.     move.l  d0,a0
  1253.     move.l  wd_RPort(a0),WinRPort(a5)
  1254.     move.l  4.w,a6
  1255.     suba.l  a1,a1
  1256.     jsr     _LVOFindTask(a6)
  1257.     move.l  d0,meinTask(a5)
  1258.     beq.s   ErrorTask
  1259.     move.l  d0,a0
  1260.     move.l  pr_WindowPtr(a0),alterTask(a5)
  1261.     move.l  WindowHandle(a5),pr_WindowPtr(a0)
  1262.     rts
  1263. ErrorTask
  1264.     bsr.s   keinTask
  1265. ErrorWindow
  1266.     moveq   #26,d7           ;26 = konnte Fenster nicht öffnen oder Task nicht finden
  1267.     rts
  1268. FensterSchliesse
  1269.     move.l  meinTask(a5),a0
  1270.     move.l  alterTask(a5),pr_WindowPtr(a0)
  1271. keinTask
  1272.     move.l  INTUIBase(a5),a6
  1273.     move.l  WindowHandle(a5),a0
  1274.     jsr     _LVOCloseWindow(a6)
  1275.     rts 
  1276. ;;
  1277. ** GadgetListeInit
  1278. * d0=WelcheSeite
  1279. *    a0=Pointer für CreateGadget
  1280. GadgetListeInit
  1281.     lea     PrintPage(a5),a1
  1282.     move.l  PrintMarkTab(a5),(a1,d0.w)
  1283.     lea     GadgetPage(a5),a1
  1284.     move.l  a3,(a1,d0.w)
  1285.     lea     GadgetListe(a5),a0
  1286.     lea     (a0,d0.w),a0
  1287.     move.l  GADBase(a5),a6
  1288.     jsr     _LVOCreateContext(a6)
  1289.     move.l  d0,a0
  1290.     beq.w   ErrorGadget
  1291.     rts
  1292. ;;
  1293. ** InitGadget
  1294. InitGadget
  1295.     lea     PrintData(a5),a1
  1296.     move.l  a1,PrintMarkTab(a5)
  1297.     moveq   #it_SIZEOF*5,d0
  1298. LoescheTextData
  1299.     move.l  #0,(a1)+
  1300.     dbra    d0,LoescheTextData
  1301.     move.b  #0,SpalteOhneTitle(a5)
  1302.     bsr.w   MenuDataInit
  1303.     moveq   #0,d6
  1304.     move.b  #0,BaM_SeitenAnzahl(a4)
  1305.     move.b  BaM_SpaltenAnzahl(a4),d6
  1306.     tst.b   d6
  1307.     bpl.s   NormalSpaltenMitTitle
  1308.     moveq   #1,d6
  1309.     move.b  #1,SpalteOhneTitle(a5)
  1310. NormalSpaltenMitTitle
  1311.     subq    #1,d6
  1312.     lea     GadgetAddr(a5),a3
  1313.     moveq   #0,d0
  1314.     bsr.s   GadgetListeInit
  1315.     moveq   #0,d3
  1316. SpaltenLoop
  1317. * a0=GadgetCreatepointer
  1318. * a3=GadgetAddr essen speicher
  1319. * a4=BangerMenu-Struct (data)
  1320. * d3=GadgetText (später nach Schleife Ende init)
  1321. * d6=Spalten Anzahl
  1322.     moveq   #0,d0
  1323.     move.b  BaM_SpaltenAnzahl(a4),d0
  1324.     tst.b   d0
  1325.     bpl.s   NormalSpalten2MitTitle
  1326.     moveq   #1,d0
  1327. NormalSpalten2MitTitle
  1328.     sub.w   d6,d0
  1329.     subq    #1,d0
  1330.     lea     BaM_SpaltenLaenge(a4),a1
  1331.     lea     (a1,d0.w),a1
  1332.     moveq   #0,d5
  1333.     move.b  (a1),d5
  1334.     move.w  d5,d2
  1335.     moveq   #10,d1
  1336.     mulu.w  d1,d2
  1337.     add.w   #60,d2
  1338.     cmp.w   HoeheWin(a5),d2
  1339.     bls.s   WinGroesseBeh
  1340.     move.w  d2,HoeheWin(a5)
  1341. WinGroesseBeh
  1342.     tst.b   d5
  1343.     beq.w   COLOhne
  1344.     subq    #1,d5
  1345.     lea     BaM_GadgetLaenge(a4),a1
  1346.     lea     (a1,d0.w),a1
  1347.     moveq   #0,d4
  1348.     move.b  (a1),d4
  1349.     asl.w   #3,d4
  1350.     add.w   #10,d4
  1351.     lea     UniGad(pc),a1
  1352.     move.w  gng_LeftEdge(a1),d1
  1353.     move.w  d4,gng_Width(a1)
  1354.     add.w   d4,d1
  1355.     cmp.w   SCBreite(a5),d1
  1356.     bhi.w   NeueSeiteInit
  1357. SeitenRueckkehr
  1358.     lea     BaM_SpaltenTitleText(a4),a1
  1359.     add.w   d0,d0
  1360.     add.w   d0,d0
  1361.     lea     (a1,d0.w),a1
  1362.     move.l  (a1),a1
  1363.     tst.b   SpalteOhneTitle(a5)
  1364.     bne.s   GSNameRichtig
  1365.     bsr.w   TextInit
  1366.     tst.b   d3
  1367.     beq.s   ErsterGadNameFind
  1368.     move.l  d3,a2
  1369.     cmp.b   #$20,-1(a2)
  1370.     beq.s   TauscheReg
  1371. ErsterGadNameFind
  1372.     tst.b   (a1)+
  1373.     bne.s   ErsterGadNameFind
  1374.     lea     1(a1),a1
  1375. GSNameRichtig
  1376.     move.l  a1,d3
  1377. TauscheReg
  1378.     exg     a4,d3
  1379. InitGadloop
  1380. * a0=GadgetCreatepointer
  1381. * a3=GadgetAddr essen speicher
  1382. * a4=GadgetText (aus der Konfig)
  1383. * d3=BangerMenuStruct
  1384. * d5=GadgetAnzahl pro Spalte
  1385. * d6=Spalten Anzahl
  1386.     moveq   #BUTTON_KIND,d0
  1387.     lea     UniGad(pc),a1
  1388.     move.l  a4,gng_GadgetText(a1)
  1389.     add.w   #10,gng_TopEdge(a1)
  1390.     add.w   #1,gng_GadgetID(a1)
  1391.     suba.l  a2,a2
  1392.     move.l  GADBase(a5),a6
  1393.     jsr     _LVOCreateGadgetA(a6)
  1394.     move.l  d0,(a3)+
  1395.     beq.w   ErrorGadget
  1396.     move.l  d0,a0
  1397.     move.l  a4,gg_UserData(a0)
  1398.     bsr.w   Return2Find
  1399.     dbra    d5,InitGadloop
  1400.     lea     UniGad(pc),a1
  1401.     move.w  #20,gng_TopEdge(a1)
  1402.     move.b  RelativeTopC(a5),d0
  1403.     add.b   d0,gng_TopEdge+1(a1)
  1404.     move.w  gng_Width(a1),d0
  1405.     add.w   d0,gng_LeftEdge(a1)
  1406.     add.w   #20,gng_LeftEdge(a1)
  1407.     exg     d3,a4
  1408. COLOhne 
  1409.     dbra    d6,SpaltenLoop
  1410.     lea     UniGad(pc),a1
  1411.     move.w  gng_LeftEdge(a1),d1
  1412.     move.w  #20,gng_LeftEdge(a1)
  1413.     move.b  RelativeLeftC(a5),d0
  1414.     add.b   d0,gng_LeftEdge+1(a1)
  1415.     move.w  #0,gng_GadgetID(a1)
  1416.     cmp.w   BreiteWin(a5),d1
  1417.     bls.s   WinBreite2Beh
  1418.     move.w  d1,BreiteWin(a5)
  1419. WinBreite2Beh
  1420.     tst.b   BaM_SeitenAnzahl(a4)
  1421.     beq.s   GadgetEndeInit
  1422.     bsr.w   SeitenGadgetInit
  1423. GadgetEndeInit
  1424.     move.b  #0,ZweitePage(a5)
  1425.     move.l  #0,(a3)
  1426.     rts
  1427. ;;
  1428. ** TextInit
  1429. * a0=GadgetCreatepointer
  1430. * a1=Zeiger auf Col Title Text
  1431. * a3=GadgetAddr essen speicher
  1432. * a4=BangerMenu-Struct (data)
  1433. * d0=Spalte
  1434. * d3=GadgetText voriges Mal
  1435. * d5=GadgetAnzahl pro Spalte
  1436. * d6=Spalten Anzahl
  1437. TextInit
  1438.     movem.l a0-a4/d7,-(sp)
  1439.     move.w  d0,d4
  1440.     lea     UniGad(pc),a2
  1441.     move.w  gng_LeftEdge(a2),d7
  1442.     move.w  gng_Width(a2),d2
  1443.     move.l  PrintMarkTab(a5),a2
  1444.     lea     it_SIZEOF(a2),a3
  1445.     move.l  a3,it_NextText(a2)
  1446.     move.l  #$02000100,(a3)
  1447.     move.w  #19,it_TopEdge(a3)
  1448.     move.l  FontAddr(a5),it_ITextFont(a3)
  1449.     move.l  a1,it_IText(a3)
  1450.     move.l  a1,a0
  1451. TextEndeLoop
  1452.     tst.b   (a1)+
  1453.     bne.s   TextEndeLoop
  1454.     sub.l   a0,a1
  1455.     move.l  a1,d0
  1456.     subq    #1,d0
  1457.     lsl.w   #3,d0
  1458.     sub.w   d0,d2
  1459.     bmi.s   TextZuLang
  1460.     lsr.w   #1,d2
  1461. TextKorritur
  1462.     add.w   d2,d7
  1463.     move.b  RelativeLeftC(a5),d2
  1464.     sub.w   d2,d7
  1465.     bpl.s   nichtFensterRand
  1466.     moveq   #0,d7
  1467. nichtFensterRand
  1468.     move.w  d7,it_LeftEdge(a3)
  1469.     move.l  a3,PrintMarkTab(a5)
  1470.     movem.l (sp)+,a0-a4/d7
  1471.     rts
  1472. TextZuLang
  1473.     neg.w   d2
  1474.     lsr.w   #1,d2
  1475.     neg.w   d2
  1476.     tst.b   d4
  1477.     beq.s   TextKorritur
  1478.     sub.b   d4,TextUOFlag(a5)
  1479.     beq.s   TextKorritur
  1480.     addq    #1,d4
  1481.     move.b  d4,TextUOFlag(a5)
  1482.     sub.w   #10,it_TopEdge(a3)
  1483.     bra.s   TextKorritur
  1484. ;;
  1485. ** NeueSeiteInit
  1486. * a0=GadgetCreatepointer
  1487. * a3=GadgetAddr essen speicher
  1488. * a4=BangerMenu-Struct (data)
  1489. * d0=Spalte
  1490. * d3=GadgetText (später nach Schleife Ende init)
  1491. * d5=GadgetAnzahl pro Spalte
  1492. * d6=Spalten Anzahl
  1493. NeueSeiteInit
  1494.     movem.l d0,-(sp)
  1495.     bsr.s   SeitenGadgetInit
  1496.     tst.b   d7
  1497.     beq.s   SeitenGadgOK
  1498.     rts
  1499. SeitenGadgOK    
  1500.     lea     UniGad(pc),a1
  1501.     move.w  gng_LeftEdge(a1),d0
  1502.     cmp.w   BreiteWin(a5),d0
  1503.     bls.s   WinBreiteBeh
  1504.     move.w  d0,BreiteWin(a5)
  1505. WinBreiteBeh
  1506.     move.w  #20,gng_LeftEdge(a1)
  1507.     move.b  RelativeLeftC(a5),d0
  1508.     add.b   d0,gng_LeftEdge+1(a1)
  1509.     move.l  #0,(a3)+
  1510.     add.b   #4,BaM_SeitenAnzahl(a4)
  1511.     move.l  PrintMarkTab(a5),a1
  1512.     move.l  #0,it_NextText(a1)
  1513.     lea     it_SIZEOF(a1),a1
  1514.     move.l  a1,PrintMarkTab(a5)
  1515.     moveq   #0,d0
  1516.     move.b  BaM_SeitenAnzahl(a4),d0
  1517.     bsr.w   GadgetListeInit
  1518.     tst.b   d7
  1519.     beq.s   NeueGadListeOK
  1520.     rts
  1521. NeueGadListeOK  
  1522.     movem.l (sp)+,d0
  1523.     bra.w   SeitenRueckkehr
  1524. ;;
  1525. ** SeitenGadgetInit
  1526. * a0=GadgetCreatepointer
  1527. * d6=Spalten Anzahl (ob noche eine Seite kommt oder nicht)
  1528. SeitenGadgetInit
  1529.     moveq   #0,d4
  1530.     move.b  BaM_SeitenAnzahl(a4),d4
  1531.     moveq   #BUTTON_KIND,d0
  1532.     lea     PageGads(pc),a1
  1533.     tst.b   ZweitePage(a5)
  1534.     beq.s   kein1Seite
  1535.     lea     PaGadTags2(pc),a2
  1536.     bra.s   doch1Seite
  1537. kein1Seite
  1538.     lea     PaGadTags(pc),a2
  1539. doch1Seite
  1540.     jsr     _LVOCreateGadgetA(a6)
  1541.     tst.l   d0
  1542.     beq.w   ErrorGadget
  1543.     move.l  d0,a0
  1544.     lea     PageLAddr(a5),a1
  1545.     lea     (a1,d4.w),a1
  1546.     move.l  d0,(a1)
  1547.     moveq   #BUTTON_KIND,d0
  1548.     lea     Page2Gads(pc),a1
  1549.     tst.b   d6
  1550.     bmi.s   kein2Seite
  1551.     cmp.b   #36,d4
  1552.     beq.s   kein2Seite
  1553.     lea     PaGadTags2(pc),a2
  1554.     bra.s   doch2Seite
  1555. kein2Seite
  1556.     lea     PaGadTags(pc),a2
  1557. doch2Seite
  1558.     jsr     _LVOCreateGadgetA(a6)
  1559.     tst.l   d0
  1560.     beq.w   ErrorGadget
  1561.     move.l  d0,a0
  1562.     lea     PageRAddr(a5),a1
  1563.     lea     (a1,d4.w),a1
  1564.     move.l  d0,(a1)
  1565.     move.b  #1,ZweitePage(a5)
  1566.     rts
  1567. ;;
  1568. ** ErrorGadget
  1569. ErrorGadget
  1570.     bsr.s   RemoveGadget
  1571.     moveq   #25,d7           ;25 = Gadget init Fehler
  1572.     rts
  1573. RemoveGadget
  1574.     move.l  GADBase(a5),a6
  1575.     bsr.w   MenuDataInit
  1576.     moveq   #0,d4
  1577.     move.b  BaM_SeitenAnzahl(a4),d4
  1578. GadListeFLoop   
  1579.     lea     GadgetListe(a5),a0
  1580.     lea     (a0,d4.w),a0
  1581.     move.l  (a0),a0
  1582.     jsr     _LVOFreeGadgets(a6)
  1583.     subq    #4,d4
  1584.     bpl.s   GadListeFLoop
  1585.     rts 
  1586. Return2Find
  1587.     tst.b   (a4)+
  1588.     bne.s   Return2Find
  1589. Return1Mal
  1590.     tst.b   (a4)+
  1591.     bne.s   Return1Mal
  1592.     cmp.b   #$20,(a4)
  1593.     bne.s   AltesKonfigFile
  1594.     lea     1(a4),a4
  1595. AltesKonfigFile 
  1596.     rts
  1597. ;;
  1598. ** Speicher freigeben von den Einstellungen
  1599. SpeicherPrefs
  1600.     move.l  FileSpeicher(a5),a1
  1601.     move.l  Filegroesse(a5),d0
  1602.     move.l  4.w,a6
  1603.     jsr     _LVOFreeMem(a6)
  1604.     rts
  1605. ;;
  1606. ** Lade Einstellungen
  1607. LadePrefs
  1608.     lea     PrefsFile1(pc),a3
  1609.     move.l  a3,d1
  1610.     move.l  #MODE_OLDFILE,d2
  1611.     move.l  DOSBase(a5),a6
  1612.     jsr     _LVOOpen(a6)
  1613.     move.l  d0,PrefsFileHandle(a5)
  1614.     bne.s   OpenPrefsFile
  1615.     lea     PrefsFileName(pc),a3
  1616.     move.l  a3,d1
  1617.     move.l  #MODE_OLDFILE,d2
  1618.     jsr     _LVOOpen(a6)
  1619.     move.l  d0,PrefsFileHandle(a5)
  1620.     beq.s   OpenFileError
  1621. OpenPrefsFile
  1622.     move.l  d0,d1
  1623.     lea     FIB(a5),a3
  1624.     move.l  a3,d2
  1625.     jsr     _LVOExamineFH(a6)
  1626.     move.l  fib_Size(a3),d0
  1627.     addq    #1,d0
  1628.     move.l  d0,Filegroesse(a5)
  1629.     cmp.l   #1,d0
  1630.     beq.s   nixPrefs
  1631.     tst.l   d0
  1632.     beq.s   nixPrefs
  1633.     move.l  #MEMF_PUBLIC!MEMF_CLEAR,d1
  1634.     move.l  4.w,a6
  1635.     jsr     _LVOAllocMem(a6)
  1636.     move.l  d0,FileSpeicher(a5)
  1637.     beq.s   ErrorFiSp
  1638.     move.l  d0,a0
  1639.     move.b  #0,(a0)+
  1640.     move.l  PrefsFileHandle(a5),d1
  1641.     move.l  a0,d2
  1642.     move.l  Filegroesse(a5),d3
  1643.     move.l  DOSBase(a5),a6
  1644.     jsr     _LVORead(a6)
  1645. SchliesseFile
  1646.     move.l  PrefsFileHandle(a5),d1
  1647.     move.l  DOSBase(a5),a6
  1648.     jsr     _LVOClose(a6)
  1649.     rts
  1650. ErrorFiSp
  1651.     moveq   #28,d7           ;28 = kein Speicher für Prefs
  1652.     bra.s   SchliesseFile
  1653. OpenFileError
  1654.     moveq   #24,d7           ;24 = konnte File BangerMenu.prefs nicht öffnen
  1655.     rts
  1656. nixPrefs
  1657.     moveq   #27,d7           ;27 = Prefs vorhanden aber leer
  1658.     bra.s   SchliesseFile
  1659. ;;
  1660. ** Library Öffnen + Schliessen
  1661. LibOeffne
  1662.     move.l  a5,a4
  1663.     lea     intname(pc),a1
  1664.     bsr.s   OeffneLib
  1665.     lea     dosname(pc),a1
  1666.     bsr.s   OeffneLib
  1667.     lea     gadname(pc),a1
  1668.     bsr.s   OeffneLib
  1669.     lea     gfxname(pc),a1
  1670.     bsr.s   OeffneLib
  1671.     rts
  1672. OeffneLib
  1673.     moveq   #37,d0
  1674.     jsr     _LVOOpenLibrary(a6)
  1675.     move.l  d0,(a4)+
  1676.     beq.s   LibError
  1677.     rts
  1678. LibError
  1679.     moveq   #22,d7                   ;22 = konnte Library nicht öffnen
  1680.     rts
  1681. LibSchliesse
  1682.     move.l  4.w,a6
  1683.     moveq   #4-1,d2
  1684.     lea     WindowHandle(a5),a4
  1685. SchliesseLib
  1686.     move.l  -(a4),a1
  1687.     cmp.l   #0,a1
  1688.     beq.s   notOpened
  1689.     jsr     _LVOCloseLibrary(a6)
  1690. notOpened
  1691.     dbra    d2,SchliesseLib
  1692.     rts
  1693. ;;
  1694. ** PubScreenOeffne
  1695. PubScreenOeffne
  1696.     tst.l   MonitorKey(a5)
  1697.     beq.w   StdPal
  1698.     tst.l   MoniID(a5)
  1699.     bne.s   IDistDa
  1700.     moveq   #32,d7
  1701.     rts
  1702. IDistDa
  1703.     move.l  MonitorKey(a5),d1
  1704.     moveq   #0,d2
  1705.     moveq   #0,d3
  1706.     move.l  DOSBase(a5),a6
  1707.     jsr     _LVOExecute(a6)
  1708.     tst.l   d0
  1709.     bne.s   NeuenMonitor
  1710.     moveq   #34,d7
  1711.     rts
  1712. NeuenMonitor
  1713.     move.l  MoniID(a5),a4
  1714.     move.l  (a4),d0
  1715.     move.l  GFXBase(a5),a6
  1716.     jsr     _LVOFindDisplayInfo(a6)
  1717.     tst.l   d0
  1718.     bne.s   MonitorDa
  1719.     moveq   #35,d7
  1720.     rts
  1721. MonitorDa
  1722.     move.l  4.w,a6
  1723. keinSignal
  1724.     moveq   #-1,d0
  1725.     jsr     _LVOAllocSignal(a6)
  1726.     move.b  d0,ScreenSignal(a5)
  1727.     bmi.b   keinSignal
  1728.     lea     MyScreenTags(pc),a1
  1729.     lea     PubScTitle(pc),a0
  1730.     move.l  a0,4(a1)
  1731.     move.l  MoniID(a5),a4
  1732.     move.l  (a4),12(a1)
  1733.     moveq   #0,d0
  1734.     move.b  ScreenSignal(a5),d0
  1735.     move.l  d0,20(a1)
  1736.     lea     PenArray(pc),a0
  1737.     move.l  a0,28(a1)
  1738.     suba.l  a0,a0
  1739.     move.l  INTUIBase(a5),a6
  1740.     jsr     _LVOOpenScreenTagList(a6)
  1741.     move.l  d0,ScreenHandle(a5)
  1742.     bne.s   Pubvorgucken
  1743.     moveq   #36,d7
  1744.     rts
  1745. Pubvorgucken
  1746.     move.l  d0,a0
  1747.     moveq   #0,d0
  1748.     jsr     _LVOPubScreenStatus(a6)
  1749.     move.w  d0,d1
  1750.     beq.w   keinPubScreen
  1751.     lea     PubScTitle(pc),a0
  1752.     bra.s   Pubgucken
  1753. StdPal
  1754.     suba.l  a0,a0
  1755. Pubgucken
  1756.     move.l  INTUIBase(a5),a6
  1757.     jsr     _LVOLockPubScreen(a6)
  1758.     tst.l   d0
  1759.     beq.s   keinPubScreen
  1760.     move.l  d0,ScreenHandle(a5)
  1761.     move.l  d0,a0
  1762.     move.w  sc_Height(a0),SCHoehe(a5)
  1763.     move.w  sc_Width(a0),SCBreite(a5)
  1764.     sub.w   #20,SCBreite(a5)
  1765.     sub.w   #50,SCHoehe(a5)
  1766.     move.l  sc_Font(a0),a1
  1767.     move.w  ta_YSize(a1),d2
  1768.     add.b   sc_WBorTop(a0),d2
  1769.     addq    #1,d2
  1770.     move.b  d2,RelativeTopC(a5)
  1771.     move.b  sc_WBorTop(a0),RelativeLeftC(a5)
  1772.     suba.l  a1,a1
  1773.     move.l  GADBase(a5),a6
  1774.     jsr     _LVOGetVisualInfoA(a6)
  1775.     move.l  d0,VisualInfo(a5)
  1776.     bne.s   VisualOK
  1777. keinPubScreen
  1778.     moveq   #23,d7
  1779. VisualOK
  1780.     rts
  1781. ScreenSchliesse
  1782.     move.l  GADBase(a5),a6
  1783.     move.l  VisualInfo(a5),a0
  1784.     jsr     _LVOFreeVisualInfo(a6)
  1785. ScrSchliesse
  1786.     move.l  INTUIBase(a5),a6
  1787.     suba.l  a0,a0
  1788.     move.l  ScreenHandle(a5),a1
  1789.     jsr     _LVOUnlockPubScreen(a6)
  1790.     cmp.b   #10,d7
  1791.     beq.s   ScreenBleibt
  1792.     move.l  ScreenHandle(a5),a0
  1793.     jsr     _LVOCloseScreen(a6)
  1794. ScreenBleibt
  1795.     rts
  1796. ;;
  1797. ** LONG Daten
  1798. Fenster_Tags
  1799.         dc.l    WA_Title,0
  1800.         dc.l    WA_Gadgets,0
  1801.         dc.l    WA_ScreenTitle,0
  1802.         dc.l    WA_Width,0
  1803.         dc.l    WA_Height,0
  1804.         dc.l    WA_Top,11
  1805.         dc.l    WA_Left,0
  1806.         dc.l    WA_PubScreen,0
  1807.         dc.l    WA_IDCMP,IDCMP_MENUPICK!IDCMP_CLOSEWINDOW!IDCMP_VANILLAKEY!IDCMP_REFRESHWINDOW!BUTTONIDCMP!RAWKEY
  1808.         dc.l    WA_Flags,WFLG_ACTIVATE!WFLG_SMART_REFRESH!WFLG_DRAGBAR!WFLG_DEPTHGADGET!WFLG_CLOSEGADGET
  1809.         dc.l    WA_NewLookMenus,-1
  1810.         dc.l    WA_AutoAdjust,-1
  1811.         dc.l    TAG_DONE
  1812. MyScreenTags
  1813.         dc.l    SA_PubName,0
  1814.         dc.l    SA_DisplayID,0
  1815.         dc.l    SA_PubSig,0
  1816.         dc.l    SA_Pens,0
  1817.         dc.l    SA_Type,WBENCHSCREEN
  1818.         dc.l    SA_Width,STDSCREENWIDTH
  1819.         dc.l    SA_Height,STDSCREENHEIGHT
  1820.         dc.l    SA_Depth,2
  1821.         dc.l    SA_SysFont,1
  1822.         dc.l    SA_Overscan,OSCAN_TEXT
  1823.         dc.l    TAG_DONE
  1824. UniGad
  1825.         dc.w    20,20,0,10
  1826.         dc.l    0,0
  1827.         dc.w    0
  1828.         dc.l    PLACETEXT_IN,0,0 
  1829. PageGads
  1830.         dc.w    20,5,14,12
  1831.         dc.l    0,0
  1832.         dc.w    10000
  1833.         dc.l    PLACETEXT_IN,0,0
  1834. Page2Gads
  1835.         dc.w    40,5,14,12
  1836.         dc.l    0,0
  1837.         dc.w    10001
  1838.         dc.l    PLACETEXT_IN,0,0
  1839. PaGadTags
  1840.         dc.l    GA_Disabled,1
  1841. PaGadTags2
  1842.         dc.l    GT_Underscore,'_'
  1843.         dc.l    TAG_DONE
  1844. MenuTags
  1845.         dc.l    GTMN_NewLookMenus,1
  1846.         dc.l    TAG_END
  1847. topaz8:
  1848.         dc.l    0
  1849.         dc.w    8
  1850.         dc.b    0,1
  1851. PenArray
  1852.         dc.w    -1
  1853. EndeReq
  1854.         dc.l    EasyStruct_SIZEOF
  1855.         dc.l    0,0,0,0
  1856. ;;
  1857. ** BYTE Daten
  1858. ParaTemplate    dc.b 'MONITORTREIBER,MONITORID/K/N,NOKEY/S',0
  1859. intname         INTNAME
  1860. dosname         DOSNAME
  1861. gadname         GADTOOLSNAME
  1862. gfxname         GRAFNAME
  1863. AbReqTi         dc.b    'About the program',0
  1864. AbReqTxt        dc.b    'BangerMenu is giftware',10
  1865.                 dc.b    'Autor: Andre´ Trettin',10,10
  1866.                 dc.b    '       Duwockskamp 33',10
  1867.                 dc.b    '       21029 Hamburg',10
  1868.                 dc.b    '       040/7246861',10
  1869.                 dc.b    '       Germany',10,10
  1870.                 dc.b    'EMail: tretti-a@rzbt.fh-hamburg.de',10,10
  1871.                 dc.b    'Greeting all how sent me a EMail about BangerMenu',10
  1872.                 dc.b    '           and my friends',0
  1873. AbGadTxt        dc.b    'OK',0
  1874. ProjektName     dc.b    'Project',0
  1875. InfoName        dc.b    'About',0
  1876. QuitName        dc.b    'Quit',0
  1877. InfoTaste       dc.b    'A',0
  1878. QuitTaste       dc.b    'Q',0
  1879. PubScTitle      dc.b    'Workbench Screen',0
  1880. PageLeftTxt     dc.b    '_<',0
  1881. PageRightTxt    dc.b    '_>',0
  1882. inputname       dc.b    'input.device',0
  1883. PrefsFileName   dc.b    'S:'
  1884. PrefsFile1      dc.b    'BangerMenu.prefs',0
  1885. topazFName8     dc.b    'topaz.font',0
  1886. WindowTitle     dc.b    'BangerMenu',0
  1887.                 dc.b    '$VER: '
  1888. ScreenTitle     dc.b    'BangerMenu 3.05 (19-Feb-96) © by Andre´ Trettin',0
  1889. ;;
  1890.